package com.max.mil.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class BaseController
{

	public HttpSession getSession()
	{
		HttpSession session = null;
		
		HttpServletRequest request = null;
		RequestAttributes ra = RequestContextHolder.getRequestAttributes();
		if(ra != null) request = ((ServletRequestAttributes)ra).getRequest();
		if(request != null) session = request.getSession();
		
		return session;
	}
}
